<%@ include file="/WEB-INF/jsp/includes.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<c:choose>
    <c:when test="${album.new}"><c:set var="method" value="post"/></c:when>
    <c:otherwise><c:set var="method" value="put"/></c:otherwise>
</c:choose>

<h2><c:if test="${album.new}"><fmt:message key="album.new"/> </c:if><fmt:message key="album.album"/>:</h2>
<form:form modelAttribute="album" method="${method}">
    <table>
        <tr>
            <th>
                <fmt:message key="album.name"/>: <form:errors path="name" cssClass="errors"/>
                <br/>
                <form:input path="name" size="30" maxlength="80"/>
            </th>
        </tr>
        <tr>
            <th>
                <fmt:message key="album.creation.date"/>: <form:errors path="creationDate" cssClass="errors"/>
                <br/>
                <form:input path="creationDate" readonly="true" id="creationDate" size="10" maxlength="10"/>
            </th>
        </tr>
        <tr>
            <th>
                <fmt:message key="album.modify.date"/>: <form:errors path="modifyDate" cssClass="errors"/>
                <br/>
                <form:input path="modifyDate" id="modifyDate" readonly="true" size="10" maxlength="10"/>
            </th>
        </tr>
        <tr>
            <th>
                <fmt:message key="album.publish.date"/> <form:errors path="publishDate" cssClass="errors"/>
                <br/>
                <form:input path="publishDate" id="publishDate" readonly="true" size="10" maxlength="10"/>
            </th>
        </tr>
        <tr>
            <th>
                <fmt:message key="album.public"/>: <form:errors path="isPublic" cssClass="errors"/>
                <br/>
                <form:checkbox path="isPublic"/>
            </th>
        </tr>
        <tr>
            <td>
                <c:choose>
                    <c:when test="${album.new}">
                        <p class="submit"><input type="submit" value="<fmt:message key="album.button.add"/>"/></p>
                    </c:when>
                    <c:otherwise>
                        <p class="submit"><input type="submit" value="<fmt:message key="album.button.update"/>"/></p>
                    </c:otherwise>
                </c:choose>
            </td>
        </tr>
    </table>
</form:form>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>
